home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Macintosh Drag and Drop / Demo Applications / FinderDrag / Spaces.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-09  |  1.5 KB  |  53 lines  |  [TEXT/MPS ]

  1. #ifndef __SPACES__
  2. #define __SPACES__
  3.  
  4. #include <Drag.h>
  5.  
  6. #define kPrivateEventClass    'Sprv'
  7. #define kAESetSpace            'SSpc'
  8. #define keyWindowOfSpace    'SpWn'
  9. #define keyNumOfSpace        'RSpN'
  10. #define keySpecOfSpace        'SpFS'
  11.  
  12.  
  13. enum {
  14.     kNoSpace        = -1,
  15.     kNumberOfSpaces    = 2,
  16.     kSpaceVSize        = 50,
  17.     kSpaceHSize        = 50    
  18. };
  19.  
  20.  
  21.  
  22.  
  23. struct SpaceRecord {
  24.     Rect        spaceRect;        // Rect for space hit detection
  25.     Handle        spaceIconSuite;    // Icon suite used to draw space (or NULL)
  26.     Boolean        spaceIsTaken;    // is this slot taken by something already?
  27.     FSSpec        spaceSpec;        // FSSpec pointing to space object- only
  28.                                 //   significant if spaceIsTaken is true
  29.     Boolean     spaceIsSelected;// is it selected ? (like in the Finder)
  30. };
  31. typedef struct SpaceRecord SpaceRecord, *SpacePtr, **SpaceHandle;
  32.  
  33. // data structure for windows
  34.  
  35. struct WindowData {
  36.     SpaceRecord        space[kNumberOfSpaces];
  37. };
  38. typedef struct WindowData WindowData, *WindowDataPtr, **WindowDataHandle;
  39.  
  40.  
  41.  
  42. void GetSpaceRect(WindowPtr win, short spaceIndex, Rect *rct);
  43. short WhichSpace(WindowPtr win, Point localPt);
  44. OSErr SendSetterToSelf(short spaceNum, WindowPtr win, FSSpecPtr hfsObj);
  45. void SendWindowSpaceSetter(WindowPtr win, DragReference theDrag, FSSpecPtr hfsObj);
  46. void SetSpaceIndex(WindowPtr win, short index, FSSpecPtr hfsObj);
  47. void GetSpaceIconSuite(WindowPtr win, short count, Handle *iconSuite);
  48. void InitSpaces(WindowDataHandle winData);
  49. pascal OSErr DoAESetSpace(AppleEvent *ae, AppleEvent *reply, long refCon);
  50. OSErr GetSpaceSpec(WindowPtr theWindow, short spaceIndex, FSSpecPtr theSpec);
  51.  
  52.  
  53. #endif